package com.salesmanager.web.common;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Liutong on 9/16/15.
 */
public enum ImageSize {
    /**
     * 原始尺寸
     */
    RAW,

    /**
     * 正常 310*310
     */
    NORMAL,

    /**
     * 小图 100*100
     */
    SMALL,

    /**
     * 超小图 50*50
     */
    XSMALL;

    private static Map<String,ImageSize> imageSizeMap = new HashMap<String, ImageSize>();

    static {
        for (ImageSize imageSize : ImageSize.values()){
            imageSizeMap.put(imageSize.name(),imageSize);
        }
    }

    public static ImageSize getByName(String name){
        return imageSizeMap.get(name);
    }
}
